package org.zch.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;
import org.zch.entity.dto.OrdersDTO;
import org.zch.entity.po.OrdersPO;
import org.zch.entity.vo.OrderInsertVO;
import org.zch.entity.vo.OrdersVO;

/**
 * 订单表(Order)表服务接口
 *
 * @author 刘新
 * @since 2024-01-10 11:19:40
 */
public interface OrdersService extends IService<OrdersPO> {

    /**
     * 新增订单
     *
     * @param ordersPO
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    OrderInsertVO insert(OrdersPO ordersPO);

    /**
     * 根据订单id，获取订单详情
     *
     * @param id 订单id
     * @return
     */
    OrdersVO getOrderById(Integer id);

    /**
     * 查询订单列表
     * @param dto 查询条件
     * @return 订单分页列表
     */
    IPage<OrdersVO> getOrders(OrdersDTO dto);

}

